<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2014/10/11
 * Time: 16:24
 * 用户组
 */
class ManageGroup extends CActiveRecord{
    public static function model($className=__CLASS__)
    {
        return parent::model($className);
    }

    public function tableName()
    {
        return 'manage_group';
    }
    /**
     * 得到键值对应关系
     * @param $iszero 是否显示0
     */
    public function getAll(){
        $all = $this->findAll();
        $result = array();
        foreach ($all as $key => $val) {
            $result[$val['group_id']] = $val['group_name'];
        }
        return $result;
    }
}